<?php 
defined('_JEXEC') or die;

// disable core styles to avoid bs conflict 
OC_Util::$core_styles = array();
$key = empty($_['key']) ? 'dir' : $_['key'];
?>

<?php if (empty($_['folderList'])): ?>
<div class="postionlisttable_nodata large yahei" style="text-align:center;">没有对应的文件夹</div>
<?php else: ?>
<div class="postionlisttable medium folderlist">
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
         <?php 
         $n=count($_['folderList']);
         for ($i=0; $i < $n; $i++) {
            $folder = $_['folderList'][$i];
            if ($i != 0 && ($i%2) == 0) {
               echo '</tr><tr>';
            }
            list($href, $selected) = PResumesHelper::getSearchItemHref($_['searchUrl'], $key, $folder->folder_id);
            list($href, $s) = PResumesHelper::getSearchItemHref($href, 'foldername', rawurlencode($folder->folder_name));
         ?>
         <td width="50%" data-fid="<?=$folder->folder_id?>">
            <a href="<?=($selected ? 'javascript:;' : $href)?>" class="link <?=($selected ? 'cur_a'  : '')?>" ><?=$folder->folder_name?><em style="color:#666666;">(<?=$folder->num?>)</em></a>
            <input class="fname" style="display:none;" type="text" value="<?=$folder->folder_name?>"/>
            <span class="editbtns hide"><i class="ok"></i> <i class="cancel"></i></span>
            <span class="btns hide"><i class="editi"></i> <i class="closei"></i></span>
         </td>
         <?php 
         }
         
         $filledNum = 2 - ($n%2);
         if ($filledNum < 2) {
            for ($i=0; $i < $filledNum; $i++) {
               echo '<td width="50%"></td>';
            }
         }
         ?>
      </tr>
   </table>
</div>
<?php endif; ?>
